package com.eventx.service.def;

import com.eventx.bus.channel.ChannelProvider;
import com.eventx.bus.event.EventSubscriber;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author: anrror
 **/
public class DefaultChannelProvider extends ChannelProvider<DefaultChannelConfig> {

    private DefaultEventSource defaultEventSource = new DefaultEventSource();

    public DefaultChannelProvider() {
        this(null);
    }

    public DefaultChannelProvider(DefaultChannelConfig channelConfig) {
        super(channelConfig);
    }

    @Override
    public void init() {

    }


    @Override
    public EventSubscriber createEventSubscriber() {
        return new DefaultEventSubscriber(defaultEventSource);
    }

    @Override
    public DefaultEventPublish createEventPublish() {
        return new DefaultEventPublish(defaultEventSource,this);
    }
}
